using System;
using System.Collections;
using System.Data;
using System.Xml;



namespace OR.Lazarus.Library.DataTier.Compiled
{
   public class FieldCollection : OR.Lazarus.Library.DataTier.Compiled.Lazarus.FieldCollection
   {
		public ObjectDetail ParentObject
		{
			get
			{
				return ( GetParentObject() );
			}
		}

		public ObjectRefDetail ParentObjectRef
		{
			get
			{
				return ( GetParentObjectRef() );
			}
		}

		protected virtual ObjectDetail GetParentObject()
		{
			ObjectDetail		vReturn		= null;
			ObjectRefDetail	vObjectRef	= null;

			if ( this.ParentEntity is ObjectDetail )
			{
				vReturn = ( ObjectDetail )ParentEntity;
			}
			else
			{
				vObjectRef = this.GetParentObjectRef();

				if ( vObjectRef != null )
				{
					vReturn = vObjectRef.ParentObject;
				}
			}

			return ( vReturn );
		}

		protected virtual ObjectRefDetail GetParentObjectRef()
		{
			ObjectRefDetail	vReturn	= null;

			if ( this.ParentEntity is ObjectRefDetail )
			{
				vReturn = ( ObjectRefDetail )ParentEntity;
			}

			return ( vReturn );
		}
   }
}
   